<% layout('/layout/default.html', {title: '伊利员工社保信息', libs: ['dataGrid']}){ %>
<div class="main-content">
		<div class="card-header">
				<i class="fa fa-cubes"></i> 伊利员工信息
			<div class="header-tools float-right">
				<a href="#" class="btn btn-default btn-sm" id="btnSearch" title="查询"><i class="fa fa-filter"></i> 查询</a>
				<% if(hasPermi('yili:yiliEmployee:edit')){ %>
					<a href="/yili/yiliEmployee/form" class="btn btn-default btn-sm btnTool"  title="新增伊利员工社保信息"><i class="fa fa-plus"></i> 新增</a>
				<% } %>
			</div>
		</div>
		<div class="container-fluid">
			<form id="searchForm" action="${ctx}/yili/yiliEmployee/listData" method="post" class="form-inline d-none" >
						<div class="form-group">
							<label class="control-label">员工编号：</label>
							<div class="control-inline">
									<input name="code"  maxlength="64" class="form-control form-control-sm"/>
							</div>
						</div>
						<div class="form-group">
							<label class="control-label">员工姓名：</label>
							<div class="control-inline">
									<input name="name"  maxlength="64" class="form-control form-control-sm"/>
							</div>
						</div>

				<div class="form-group">
					<button type="submit" class="btn btn-success btn-sm">查询</button>
					<button type="reset" class="btn btn-default btn-sm">重置</button>
				</div>
			</form>
			<table id="dataGrid"></table>
			<div id="dataGridPage"></div>
		</div>
</div>
<% } %>
<script>
//初始化DataGrid对象
$('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	columnModel: [
				{header:'员工编号', name:'code', index:'a.code', width:90, align:"center"},
				{header:'员工姓名', name:'name', index:'a.name', width:90, align:"center"},
				{header:'性别', name:'gender', index:'a.gender', width:90, align:"center", formatter: function(val, obj, row, act){
						return js.transDictLabel(${@DictUtils.getDictListJson('sex')}, val, '未知');
					}},
				{header:'出生日期', name:'birthday', index:'a.birthday', width:90, align:"center", formatter:"date"},
				{header:'年龄', name:'age', index:'a.age', width:90, align:"center"},
				{header:'所属部门', name:'office.name', index:'a.office_id', width:90, align:"center"},
				{header:'更新时间', name:'updateDate', index:'a.update_date', width:90, align:"center", formatter:"date"},
		{header:'操作', name:'actions', width:100, sortable:false, title:false, align:"center",formatter: function(val, obj, row, act){
			var actions = [];
			<% if(hasPermi('yili:yiliEmployee:edit')){ %>
				actions.push('<a href="/yili/yiliEmployee/form?id='+row.id+'" class="btnList" title="编辑伊利员工社保信息"><i class="fas fa-pencil-alt"></i></a>&nbsp;');
				actions.push('<a href="/yili/yiliSocialSecurityInfo/list?employeeId='+row.id+'" class="btnList" title="查看社保缴费详情"><i class="fab fa-elementor"></i>&nbsp;</a>');
				actions.push('<a href="${ctx}/yili/yiliEmployee/delete?id='+row.id+'" class="btnList" title="删除伊利员工社保信息" data-confirm="确认要删除该伊利员工社保信息吗？"><i class="far fa-trash-alt"></i></a>&nbsp;');
			<% } %>

			return actions.join('');
		}}
	],
	// 加载成功后执行事件
	ajaxSuccess: function(data){

	}
});

</script>